package ordersModel

import (
	"gitee.com/libwiki/go-zero-lib/models"
	"gitee.com/libwiki/go-zero-lib/package/orm/vars"
)

// SubOrders 子订单
type SubOrders struct {
	Code           string        `json:"code" gorm:"type:varchar(64);comment:子订单唯一code"`
	Uid            uint          `json:"uid" gorm:"comment:所属用户"`
	StoreId        uint          `json:"store_id" gorm:"comment:所属门店"`
	SourceId       uint          `json:"source_id" gorm:"comment:货源id"`
	ProductId      uint          `json:"product_id" gorm:"comment:商品ID"`
	ProductSkuCode string        `json:"product_sku_code" gorm:"type:varchar(64);comment:商品规格code"`
	PaymentId      uint          `json:"payment_id" gorm:"comment:支付单ID"`
	OrderAmount    float64       `json:"order_amount" gorm:"type:decimal(12,2);default:0;comment:订单总额"`
	CarriageAmount float64       `json:"carriage_amount" gorm:"type:decimal(12,2);default:0;comment:运费总额"`
	DiscountAmount float64       `json:"discount_amount" gorm:"type:decimal(12,2);default:0;comment:优惠金额"`
	PayAmount      float64       `json:"pay_amount" gorm:"type:decimal(12,2);default:0;comment:应付金额"`
	PaidAmount     float64       `json:"paid_amount" gorm:"type:decimal(12,2);default:0;comment:已付金额"`
	IsPay          bool          `json:"is_pay" gorm:"default:0;comment:支付状态"`
	PaidTime       vars.Datetime `json:"paid_time" gorm:"comment:完成支付时间"`

	models.BaseModel
	models.DeleteField
}
